package webapp.mvc.services;

import com.zoowii.jpa_utils.extension.Paginator;
import webapp.mvc.controllers.forms.CreateShopFeedbackForm;
import webapp.mvc.controllers.forms.CreateShopForm;
import webapp.mvc.controllers.forms.UpdateShopForm;
import webapp.mvc.exceptions.ShopException;
import webapp.mvc.models.ShopChangeRequestEntity;
import webapp.mvc.models.ShopCommentEntity;
import webapp.mvc.models.ShopEntity;
import webapp.mvc.models.ShopFeedbackEntity;

import java.util.List;

public interface IShopService {
    List<ShopEntity> getShops(String categoryId, Paginator paginator);

    List<ShopChangeRequestEntity> getShopChangeRequests(Paginator paginator);

    ShopEntity agreeShopChangeRequest(String requestId);

    ShopChangeRequestEntity disagreeShopChangeRequest(String requestId);

    List<ShopEntity> searchShops(String keyword, Paginator paginator);

    ShopEntity createShop(String userId, CreateShopForm createShopForm) throws ShopException;

    ShopEntity updateShop(String updateUserId, String shopId, UpdateShopForm updateShopForm) throws ShopException;

    ShopCommentEntity createShopComment(String userId, String shopId, String title, String content) throws ShopException;

    List<ShopCommentEntity> getShopLatestComments(String shopId, int limit);
    List<ShopCommentEntity> getShopComments(String shopId, Paginator paginator);
    void deleteShopComments(List<String> ids);
    ShopFeedbackEntity createShopFeedback(String userId, String shopId, CreateShopFeedbackForm createShopFeedbackForm) throws ShopException;
    List<ShopFeedbackEntity> getShopFeedbacks(String shopId, Paginator paginator);
    ShopEntity findById(String id);
    void collectShop(String shopId, String userId);
    void unCollectShop(String shopId, String userId);
    boolean isCollectedShop(String shopId, String userId);
    List<ShopEntity> getUserCollectedShops(String userId, Paginator paginator);

    List<ShopEntity> getShopsOwnedByUser(String userId);

    void setShopsRelated(List<ShopEntity> shopEntities);
    List<ShopEntity> getHotestShops(int limit);
}
